<%@ page language="java" import="java.util.*,java.net.URLDecoder" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String loginName="";
String uid="";
Cookie[] cookArr = request.getCookies();
if(cookArr!=null){
	for(Cookie c:cookArr){
		if(c.getName().equals("LOGINNAME")){
			loginName = URLDecoder.decode(c.getValue(),"UTF-8");
		}
		if(c.getName().equals("UID")){
			uid = c.getValue();
		}
		c.getValue();
	}
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
	<title>修改地址</title>
	<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">
		function my(){
			var msg = '${MSG}';
			if(msg!=""){
				alert(msg);
			}
		}
	</script>
	<script type="text/javascript">
		function checkLogin(){
			var name = document.getElementsByName("name")[0].value;
			var phone = document.getElementsByName("phone")[0].value;
			var addr = document.getElementsByName("addr")[0].value;
		    var province = document.getElementsByName("province")[0].value;
			var city = document.getElementsByName("city")[0].value;
			var district = document.getElementsByName("district")[0].value;
			if(name=="" || name==null){
				alert("收货人姓名不能为空");
				return false;
			}else if(phone=="" || phone==null){
				alert("收货人电话不能为空");
				return false;
			}else if(addr=="" || addr==null){
				alert("详细地址不能为空");
				return false;
			}else if(province=="" || province==null){
				alert("所在省份不能为空");
				return false;
			}
			else if(city=="" || city==null){
				alert("所在市不能为空");
				return false;
			}
			else if(district=="" || district==null){
				alert("所在区不能为空");
				return false;
			}
			
			return true;
		}
	</script>
</head>
<body onclick="my()">
<div class="page-container">
	<div >修改商品信息:</div>
	<form class="form form-horizontal" id="form-article-add" action="<%=basePath%>address/editAddr.do" method="post" onsubmit="return checkLogin()">
		<input type="hidden" name="shop_id" value="${shop_id}">
		<input type="hidden" name="gnumber" value="${gnumber}">
		<input type="hidden" name="aid" value="${addr.aid }">
  	 	<input type="hidden" name="uid" value="<%=uid%>">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span style="color: red;">*</span>收件人姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${addr.name }"  name="name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span style="color: red;">*</span>所在省份：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${addr.province }"  name="province">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span style="color: red;">*</span>所在市：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${addr.city }"  name="city">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span style="color: red;">*</span>所在区：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="${addr.district }" name="district">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span style="color: red;">*</span>详细地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text"  value="${addr.addr }" name="addr">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span style="color: red;">*</span>联系电话：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text"  value="${addr.phone }" name="phone">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">邮政编码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text"  value="${addr.postcode }" name="postcode">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">默认地址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<c:if test="${addr.type==1 }">
					<input type="radio" value="1" name="type" checked="checked">是
					<input type="radio" value="0" name="type"  >否
				</c:if>
				<c:if test="${addr.type==null }">
					<input type="radio" value="1" name="type" >是
					<input type="radio" value="0" name="type" checked="checked" >否
				</c:if>
				<c:if test="${addr.type==0 }">
					<input type="radio" value="1" name="type" >是
					<input type="radio" value="0" name="type" checked="checked" >否
				</c:if>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<input type="submit" class="btn btn-primary radius" type="button" value="修改并提交审核">
			</div>
		</div>
	</form>
</div>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript" src="../lib/webuploader/0.1.5/webuploader.min.js"></script> 
>
</body>
</html>
